package com.xl.singleton.lazy;

/*
懒汉式+同步方法单例
优点是线程安全，懒加载
缺点是效率不高
*/

public class LazyTwo {
  private static LazyTwo mInstance;
  private LazyTwo(){}
  public static synchronized LazyTwo getInstance(){
    if(mInstance == null){
      mInstance = new LazyTwo();
    }
    return mInstance;
  }
}